"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var fs_1 = require("fs");
var network_1 = __importDefault(require("../core/v2/network"));
var n = new network_1.default('crossEntropy');
n.addLayer(1, 100, 'relu');
n.addLayer(100, 100, 'relu');
n.addLayer(100, 100, 'relu');
n.addLayer(100, 1, 'relu');
var trainingData = [
    { input: [1], output: [1] },
    { input: [2], output: [2] },
    { input: [3], output: [3] },
    { input: [4], output: [4] }
];
var testingData = [
    { input: [5], output: [5] },
    { input: [6], output: [6] },
    { input: [7], output: [7] },
    { input: [8], output: [8] }
];
fs_1.writeFileSync('./loss', n.fit(trainingData, testingData, 1e-3, Infinity, 1).join('\n'));
fs_1.writeFileSync('./model.json', JSON.stringify(n.snapshot()));
for (var _i = 0, trainingData_1 = trainingData; _i < trainingData_1.length; _i++) {
    var i = trainingData_1[_i];
    console.log(n.feedforward(i.input), i.output);
}
